import { Component } from 'react';
import DemoState from './01.定义状态'
import DemoEventFn from './02.事件处理-更改this指向';
import DemoFormInput from './03.受控与非受控组件';
import DemoComment from './05.案例-发表评论';
import DemoFormCom from './06.表单组件';
import ParentToChildRef from './07.组件间传值(通信)/7.1.父传子/7.1.2父传子-ref&refs/Parent';
import DemoParentToChild from './07.组件间传值(通信)/7.1.父传子/7.1.1父传子props/Parent';
// import DemoComp from "./pages/案例/07.组件间传值(通信)/DemoCom";
import DemoP1 from './07.组件间传值(通信)/7.2.子传父/Parent';
import CommentIndex from './07.组件间传值(通信)/7.2.子传父/案例评论comment/CommentIndex';
import DemoSetStateAttr from './08.setState/setState修改对象下面的属性状态';
import DemoSetStateSync from './08.setState/setState同步还是异步';
import './global.scss'
import TransferToChildParent from './07.组件间传值(通信)/7.3跨级组件通信/Parent';
import DemoCLassArr from './09.动态class/class为数组形式';
import ClassIndex from './10.css模块化/ClassIndex';
import './global.scss'
import ImageScr from './11.引用本地资源图片/ImageSrc';
import Life1 from './12.类组件的生命周期/Life1';
class Demo extends Component {
   state = {
     isShow: true
   }
    render() {
        return (
            <>
                <h1>案例（知识点）</h1>
                <h2>12. 类组件的生命周期</h2>
                  {
                    this.state.isShow ? <Life1 /> : ''
                  }
                  <button onClick={() => {
                    this.setState({
                      isShow: false
                    })
                  }}>销毁Life组件</button>
                <h2>11. 项目中引用本地资源图片</h2>
                <ImageScr />
                <h2>10. css模块化</h2>
                <ClassIndex />
                <h2>9. 动态class</h2>
                <DemoCLassArr />
                
                {/* 7. 组件间传值 */}
                <h2>7. 组件间传值(通信)</h2>
                {/* 7.3 跨级组件通信 */}
                <h3>7.3 跨级组件通信</h3>
                <TransferToChildParent />
                {/* 7.1 父传子 */}
                 <DemoParentToChild />
                 <ParentToChildRef />
                 {/* 7.2 子组件和父组件通信 */}
                 <DemoP1 />
                 {/* 子传父 案例：添加评论案例 */}
                 {/* 7. 组件间传值 end */}
                  <CommentIndex />
                 {/*8.1setState同步异步问题 */}
                 <DemoSetStateSync />
                 <DemoSetStateAttr />
                 {/* 0-06案例 start */}
                <DemoState />
                <DemoEventFn />
                <DemoFormInput />
                <DemoComment />
                <DemoFormCom />
                {/* 01-06案例end */}
               
            </>
        );
    }
}

export default Demo;